package study.javaee.practice.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import study.javaee.practice.common.BO.ResultBO;
import study.javaee.practice.entity.vo.MemberVO;
import study.javaee.practice.entity.vo.ProjectJoinApplyVO;
import study.javaee.practice.service.impl.ProjectMemberServiceImpl;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

@RestController
@RequestMapping("/ProjectMember")
public class ProjectMemberController {

    @Autowired
    private ProjectMemberServiceImpl projectMemberService;


    @PostMapping("/insertProjectMember")
    public ResultBO insertProjectMember(ProjectJoinApplyVO data, HttpServletResponse response){
        Boolean b=projectMemberService.insertProjectMember(data);
        if(null!=b)
        {
            return new ResultBO(20000);
        }
        else {
            return new ResultBO(400);
        }
    }

    @GetMapping("/findAllProjectMember")
    public List<MemberVO> findAllMember(MemberVO data, HttpServletRequest request){
        return projectMemberService.findAllMember(data);
    }
}
